<?php

Pfw_Loader::loadClass('Pfw_Controller_Route_SegmentCondition');

class Prj_Controller_Route_BeginEndCondition implements Pfw_Controller_Route_SegmentCondition {
    public function __construct($begin, $end) {
        $this->begin = $begin;
        $this->end = $end;
    }
    
    public function exec($subject) {
        if (!preg_match("/^{$this->begin}/", $subject) or !preg_match("/{$this->end}\$/", $subject)) {
            return false;
        }
        return true;
    }
}
